package com.itheima.web.controller;

import com.itheima.domain.Banner;
import com.itheima.domain.Movies;
import com.itheima.service.BannerService;
import com.itheima.service.MoviesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@CrossOrigin("*")
@RestController
public class IndexController {

    @Autowired
    private BannerService bannerService;

    // 轮播图查询
    @GetMapping("/index/findBannerList")
    public List<Banner> findBannerList() {
        return bannerService.findBannerList();
    }

    @Autowired
    private MoviesService moviesService;

    // 影视列表查询
    @GetMapping("/index/findMoviesListMap")
    public Map<String, List<Movies>> findMoviesListMap() {
        return moviesService.findMoviesListMap();
    }

}
